<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="calcBean" class="xiongll.web.Bean.CalculatorBean"/>
<jsp:setProperty name="calcBean" property="*"/>
<% 
//使用CalculatorBean进行计算
 calcBean.calculate();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- 两种写法 -->
 	计算结果是：
   <%=calcBean.getFirstNum() %>
   <%=calcBean.getOperator() %>
   <%=calcBean.getSecondNum()%>
      =
   <%=calcBean.getResult() %>
   
     
     <br/><br/>
    <form action="demo.jsp" method="post">
        <table border="1px">
            <tr>
                <td colspan="2">简单的计算器</td>
            </tr>
            <tr>
                <td>第一个参数</td>
                <td><input type="text" name="firstNum"></td>
            </tr>
            <tr>
                <td>运算符</td>
                <td><select name="operator">
                        <option value="+">+</option>
                        <option value="-">-</option>
                        <option value="*">*</option>
                        <option value="/">/</option>
                </select></td>
            </tr>
            <tr>
                <td>第二个参数</td>
                <td><input type="text" name="secondNum"></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="计算"></td>
            </tr>
        </table>
    </form>
</body>
</html>